package brokers;


import models.SLA;

import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.core.SimEvent;

import util.Globals;

public class FCFSBroker extends SkeletonBroker {

	public FCFSBroker(String name, double endSimulationTime, SLA sla1, SLA sla2) throws Exception {
		super(name, endSimulationTime, sla1, sla2);
		priority1 = 0;
		priority2 = 0;
	}


	/**
	 * Process a cloudlet return event.
	 *
	 * @param ev a SimEvent object
	 *
	 * @pre ev != $null
	 * @post $none
	 */
	@Override
	protected void processCloudletReturn(SimEvent ev) {

		super.processCloudletReturn(ev);

		if (mycloudletList.size()>0 && CloudSim.clock() < endSimulationTime && returned < Globals.SIMULATION_STABILIZATION_CLOUDLETS + Globals.SIMULATION_CLOUDLETS) {
			submitCloudlets();
		}
	}


}
